package com.sky.mapper;

import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface OrderDetailMapper {

    void insertBatch(ArrayList<OrderDetail> list);

    List<OrderDetail> selectByOrderId(Long orderId);

    /**
     * 根据订单id删除订单详情表的内容
     * @param orderId
     */
    @Delete("delete from sky_take_out.order_detail where order_id=#{orderId}")
    void deleteByOrderId(Long orderId);
}
